import service from "@/utils/request"
import type { attrListModel } from "./model/attr"
enum API {
  getAttrInfoList = '/admin/product/attrInfoList',
  deleteAttr = '/admin/product/deleteAttr',
  saveAttrInfoList = '/admin/product/saveAttrInfo'
}


// 获取属性信息列表
export const reqGetAttrInfoList = (category1Id: number, category2Id: number, category3Id: number) => service.get<any, attrListModel>(`${API.getAttrInfoList}/${category1Id}/${category2Id}/${category3Id}`)

// 删除属性
export const reqDeleteAttr = (attrId: number) => service.delete(`${API.deleteAttr}/${attrId}`)

// 保存属性
export const reqSaveAttrInfoList = (attrInfoList: attrListModel) => service.post(API.saveAttrInfoList, attrInfoList)